# Maintainer: Sven-Hendrik Haase <svenstaro@gmail.com>
# Contributor: Rolinh <robinDOThahlingATgw-computingDOTnet>

pkgname=dfc
pkgver=3.1.1
pkgrel=3
pkgdesc="Display file system space usage using graphs and colors"
arch=('loong64' 'x86_64')
url="http://projects.gw-computing.net/projects/dfc"
license=('BSD')
depends=('glibc')
makedepends=('cmake' 'gettext' 'ninja')
source=("$pkgname-$pkgver.tar.gz::https://github.com/Rolinh/dfc/archive/v${pkgver}.tar.gz")
sha512sums=('0dded1824e6e6734214999f898d253fab760bb69b0f152b44e47b54b30c6ebcf4ac04cec44a37eb655548d4dbaef9328a6b383957b5b8fe6e20cb550d51d46e2')

build() {
  cd "${pkgname}-${pkgver}"

  cmake \
    -B build \
    -G Ninja \
    -DPREFIX=/usr \
    -DSYSCONFDIR=/etc \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE
  ninja -C build
}

package() {
  cd "${pkgname}-${pkgver}"

  DESTDIR="${pkgdir}" ninja -C build install

  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim:set ts=2 sw=2 et:
